Telegram Group & Telegram Channel
🎓 Задача по Python #44

Описание


Напишите программу, которая проверяет, является ли число числом Армстронга.

Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр.

Пример:


3**3 + 7**3 + 1**3 = 371

Решение:

def armstrong_number(num):
sum = 0
length = len(str(num))
for digit in list(str(num)):
sum += int(digit)**length
return sum == num


Свой вариант решения в комментарии 💬

#задачи



tg-me.com/pythonturboru/556
Create:
Last Update:

🎓 Задача по Python #44

Описание


Напишите программу, которая проверяет, является ли число числом Армстронга.

Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр.

Пример:


3**3 + 7**3 + 1**3 = 371

Решение:

def armstrong_number(num):
sum = 0
length = len(str(num))
for digit in list(str(num)):
sum += int(digit)**length
return sum == num


Свой вариант решения в комментарии 💬

#задачи

BY Python Turbo. Уютное сообщество Python разработчиков.




Share with your friend now:
tg-me.com/pythonturboru/556

View MORE
Open in Telegram


Python Turbo Уютное сообщество Python разработчиков Telegram | DID YOU KNOW?

Date: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.Python Turbo Уютное сообщество Python разработчиков from jp


Telegram Python Turbo. Уютное сообщество Python разработчиков.
FROM USA